﻿using System;
using System.Diagnostics.Contracts;

namespace OpenLS.Spreadsheet
{
    class UnparsedFormula: CellFormulaBase
    {
        private readonly string _text;

        public UnparsedFormula(string text)
        {
            Contract.Requires(text != null);
            this._text = text;
        }
        public override string Text
        {
            get { return _text; }
        }
        public override string TextWithoutEqual
        {
            get
            {
                if (_text.StartsWith("="))
                return _text.Substring(1, _text.Length - 1);
                return _text;
            }
        }
        internal override object GetValue()
        {
            return new UnparsedFormulaResult();
        }

        public override CellFormulaBase Offset(CellRelativeAddress cellRelativeAddress)
        {
            return this;
        }


        class UnparsedFormulaResult{}

    }
}